--A Guide to Cubic Ligation--

Prerequisite knowledge : SSC knowledge, 3D SSC knowledge, global variables.

CL is mostly a technical doodle for me, but hey, it turned out sexah :P
It only has two distinct scopes, an assigner and many drones.
By a little coding "magic" I was able to make the cube configure itself when more drones are added... nifty huh? :)
For tutoring purposes, I will assume that you know the "old" avs functions but has no idea on the new stuffs [namely loop(, gmegabuf(, assign(, and exec3(] Unlikely, but ah well. Read and learn. (please? :P)

/////----------\\\\\

First, the drones (or mindless cubes in this matter). They're any of the scopes after the comment inside the list.

The init only has the n value and a remnant from my SSC template (namely pi=acos(-1). Never deleted that for some reason...). The point part only describes the cube, rotations, and using skip for unnecessant points instead of simple blacking out. Nifty to me, but not sure about you - We won't go into that, but tell me if you think I should...

Anyways, on to the important stuff - The Frame section.
For flexibility, all of the scopes are the same, and yet they correctly fade and resize according to their number. This, people, is the one of the useful uses of global variables.
reg00 is a counter, going by 10s. The first drone increases reg00 by 10 once, so reg00 is 10 for that scope. The second scope adds another 10, so reg00 is 20 for that scope. Once reg00 reaches the last scope, it will pass through the assigner scope again. The assigner does some stuffs with the value and resets reg00 to zero and the cycle starts again. It works like a p-counter in a scope if you've done p2p coding before.

Next is r. It's just the size of the scope - It's simply the counter times "dif" (more on that when we get to the assigner). This is how the scope adjusts itself to the crowd sizewise ;)
Then there's c1. It creates the bw gradient from the first to last. What is reg08, you ask? It is only the final value of reg00 before it is reset. This way, you can get the upper bound of reg00 and a correct gradient can be made.

After that is the recall from the global array (gmegabuf). The assigned value counts down instead of counting up, more on that on the assigner section.
So why was the counting done in tens? Well, for easy recalling. The recalled variable is simply the max number minus the current number plus another number. since the former two are counted in tens, there are 10 possible subvalues for each number. The third number is the subvalue number. x-rotation is 1, y-rotation is 2, z-rotation is 3. Quite a bit easier to code than to have clusters dedicated to each rotation to me :)
There's also subvalue #6 in the c1 line - It's the onbeat whiting. Now go back to the point section. Scroll all the way down. As you can see, there's another gmegabuf section. The x-movement is subvalue #4, and the y-movement is subvalue #5.

After the gmegabuf(s, there's the rotation sines and cosines and the rgb assignment. If you need any tutoring there, you're looking at the wrong place.

So how does the delay effect happen? That's next, in the assigner.

(end drone section)

///-------\\\

Second, the (pretty huge) [and halfway 1337] assigner. It's the very first scope, if you don't know which one it is.

First thing that you get to see is what most people are meant to see - dif, the distance variable, and reg51, the aspect ratio. Nothing amazing there.

Now scroll down past the first comment block, down to reg01. If reg01 is now in the topmost line, you should be able to see the assigns.
This set of assigns (and any further ones that begin a line) are the initial settings of the rotations. The leader cube (smallest, right after the comment) gets to use this value directly.


Next, scroll until the first loop( is at top.
This is the heart of the delay effect (as are the later loops). This follows p2p assigning quite closely. First, there's reg00 as the amount of times it is repeated. A bit of an overkill, but I don't care :P (Seriously though, if you're using loop yourself, use the amount of loops needed plus one just in case. don't be wasteful and lazy like me. please?)
After the amount of loops, there's the exec3. I know that the help file only shows exec2, but exec3 exists. It's a bit like exec2 except that it executes two things before returning the value (of the third stuff).
First is the p-counter, assigned using - surprise surprise - assign(. Just think of the comma as an equal sign.
Second is the delay effect. It takes a certain part of an array and assigns to it the part of the array ten "steps" forward. (one step if you count the units as a subvalue like me). Because the assignment "sweeps" from zero up, the nth unit before the assigned unit needs n passes to be assigned. Since this is calculated per frame, it also takes n frames to be assigned, and so we have our delay effect. Gotta love niftiness.

A couple lines down is another assigner for x-y movement, then onbeat lighting.
You may notice by now the repeated p=0. Well, p is set to a much higher number at the end of each loop, so it needs to be reset.
Last is a familiar sight - reg00 and reg08/9. As you can see, reg08 is set to reg00 right before reg00 is reset to 0.

There's the onBeat, nothing special there.

//////

And that's... it I guess.
Implement as you will, no direct ripping thank you. Coin me too :p

Challenge : Fix the delayed start if you wish. It's fixed in the final version ;)